package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;



public class HELLOANDROIDActivity extends Activity implements OnClickListener {
	private int i = 0;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        
//			setContentView(tv);        
        LinearLayout linearLayout = new LinearLayout(this);
        linearLayout.setOrientation(LinearLayout.VERTICAL);
        TextView textView = new TextView (this);
        textView.setText(R.string.hello);
        linearLayout.addView(textView);
        Button button = new Button (this);
        linearLayout.addView(button);
        
        setContentView(linearLayout);
        update (button);
        
        button.setOnClickListener(this);
    }
    
    private void update(Button button){
    	button.setText("Click Nu " +i++);
    	
    }

	public void onClick(View button) {
		update((Button) button);
		
	}
}